#include "matrix.cpp"
#include "modelT.hpp"
#include "model.hpp"
#include "arcball.hpp"
#include "window.hpp"
#include <iostream>

using namespace std;

void testMatrix(){

	Matrix<double> m1,m2,m3,m4,m5,m6;
	double t1[4] = {1.,0.,-1.,3.};

	//Constructeur 1
	cout<<"M1"<<endl;
	m1 = Matrix<double>();
	m1.print();

	//Constructeur 2
	cout<<"M2"<<endl;
	m1 = Matrix<double>(2,2);
	m1.print();

	//Constructeur 3
	cout<<"M3"<<endl;
	m1 = Matrix<double>(2,2);
	m1.print();

	//Constructeur 4
	cout<<"M4"<<endl;
	m1 = Matrix<double>(2,2,t1);
	m1.print();


	//Constructeur 4
	cout<<"Mult"<<endl;
	m1 = Matrix<double>(2,2,t1);
	m2 = Matrix<double>(2,2,t1);
	m1 *= m2;
	m1.print();
}

void testModel(){
vector<double> c;
	model *m = model::importFromFile("../data/cube.txt");

	cout<<"Affichage"<<endl;
	m->print();

	cout<<"Suppression"<<endl;
	delete m;
}

void testModeleT(){
vector<double> c;
	modelTextured *mt = modelTextured::importFromFile("../data/head.txt");

	cout<<"Affichage"<<endl;
	mt->print();

	cout<<"Suppression"<<endl;
	delete mt;
}

void testArcBall(){
	vector<int> c;
	model *mt = model::importFromFile("../data/cube.txt");
	arcball *ab = new arcball(c, 5., mt);


	cout<<"Action 1"<<endl;
	ab->mousePressed(0,0);
	cout<<"Action 2"<<endl;
	ab->mouseDragged(1,0);
	cout<<"Action 3"<<endl;
	ab->mouseDragged(2,0);
	cout<<"Action 4"<<endl;
	ab->mouseReleased(5,0);

	cout<<"Affichage"<<endl;
	mt->print();

	cout<<"Suppression"<<endl;
	delete ab;
	delete mt;
}

void testWindow(){
	cout<<"Init win"<<endl;
	init();
	cout<<"Launch"<<endl;
	launch(0,NULL);
	cout<<"Destroy"<<endl;
	destroy();
}

int main(){

	//testMatrix();
	//testModel();
	//testModeleT();
	//testArcBall();
	testWindow();

	return 0;
}
